package com.luzhikun.util;

import com.luzhikun.Service.impl.CityServiceImpl;
import org.junit.Test;

/**
 * @Author Rookie Coder
 * @Description
 * @Date
 **/
public class ServiceFactory {

    // 传入被代理类对象，得到代理类对象
    public static Object getService(Object target){

        return new TransactionInvocationHandler(target).getProxy();


    }

    @Test
    public void test1(){

        CityServiceImpl service = (CityServiceImpl) ServiceFactory.getService(new CityServiceImpl());
        System.out.println(service.getClass());
    }

}
